package com.dongdongshop.consume;

import com.dongdongshop.service.ItemPageService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@RocketMQMessageListener(topic = "tbGoods",consumerGroup = "tbGoods_Html")
public class RocketMQConsumeEntity implements RocketMQListener<Long[]> {
    @Autowired
    private ItemPageService itemPageService;

    @Override
    public void onMessage(Long[] aLong) {
        System.out.println(aLong);
        if (aLong.length <= 0){
            return;
        }
        for (Long goodsId : aLong) {
            itemPageService.itemPage(goodsId);
        }
    }
}
